﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="fw.aspx.cs" Inherits="DAGApp.fw" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <title>上海农副产品质量安全信息查询</title>
		<link rel="stylesheet" href="css/public.css" />
		<link rel="stylesheet" href="css/farm_produce_2.css" />
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <script src="js/jquery-2.1.0.js"></script>
    <style>

   .triangle-up {
        width: 0.2rem;
        margin: 0 auto 0.07rem;
        border-left: 0.04rem solid transparent;
        border-right: 0.04rem solid transparent;
        border-bottom: 0.04rem solid red;
        transform: rotate(45deg);
        transform-origin: left;
        position:relative;
    }
    .triangle-up:after {
        content: '';
        display: block;
        width: 0.2rem;
        height: 0.04rem;
        border-left: 0.04rem solid transparent;
        border-right: 0.04rem solid transparent;
        border-top: 0.04rem solid red;
        position: absolute;
        right: -0.1rem;
        top: -0.1rem;
        transform: rotate(90deg);
        transform-origin: bottom;
    }

	body{
		margin: 0 0.2rem;
		font-size: 0.24rem;
	}
	#green{
		color:#099D4B ;
		border-bottom:#099D4B 0.05rem solid ;
		padding-bottom: 0.2rem;
		text-align: center;
        font-size:0.48rem;
	} 
    #resultContent{
        
    }
    </style>
</head>
<body>
  <img src="img/farm_produce_top.png" style="width: 100%;" />
		<h2 id="green">查验真伪</h2>
		<div style="font-size: 0.34rem;margin:0.2rem 0 0 0.1rem;">存档照片</div>
		<img src="img/qr_code_img.png" style="margin: 0.5rem auto;display: block;width: 60%;" />
		<%--<div style="font-size: 0.24rem;">对比实物标签与照片：</div>
		<ul style="font-size: 0.24rem;padding: 0.2rem 0
 0.3rem 0;">
			<li>11111111111111111</li>
			<li>22222222222222</li>
			<li>333333333333333</li>
		</ul>
		<p>以上特征相符,则是真品,否则谨防假冒！</p>--%>
   
    <div id="resultContent" runat="server">
        
      </div>

	 <div class="row">
          <div class="col-xs-6">
                 <%--   查询记录--%>
                </div>
                <div class="col-xs-3">
                    <span id="flexible" class="triangle-up" style="position:relative; top:15px; float:right;" title="收起"">    <!--向下的三角--> </span>

                </div>
            </div>	
     <div class="row-fluid" id="result">
            
            </div>
</body>
    <script type="text/javascript" src="js/public.js" >

    </script>
</html>
<script type="text/javascript">
    $(function () {
        $('#flexible').on("click",function (e) {
            getlog();
            onFlexible(e)
        });
    })
   
    function getlog() {
     
        var code = getUrlParam("code");
     
        var html = "<table style=\"width:90%;font-size='0.28rem'\">";
        html += "<tr><td style=\"width:40%;\">" + "查询时间" + "</td> <td  style=\"width:40%;\">" +"ip地址" + "</td></tr>";
     
        $.ajax({
            type: "post",
            url: "/FangWei.ashx?oper=GetList&type=1&code=" + code,

            success: function (data) {
             
                $.each(JSON.parse(data), function (i, item) {
                    html += "<tr><td style=\"width:40%;\">" + formatDateTime(item.QueryTime) + "</td> <td  style=\"width:40%;\">" + item.QueryValue + "</td></tr>";
                });

                $('#result').html(html + "</table>");

            }
        })
    }
    
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    };
    var formatDateTime = function (date) {
        // 2017-07-05T10:52:03
        var datetime = date.split('T');
        return datetime[0] + " " + datetime[1]
    };

    //伸缩
    function onFlexible() {
        if ($('#flexible').attr("title") == "收起") {
            $('#flexible').attr("title", "展开").css({"transform":"rotate(225deg)","top":"0.2rem","left":"0.2rem"});
            $("#result").show();
        }
        else {
            $('#flexible').attr("title", "收起").css({ "transform": "rotate(45deg)", "top": "0.1rem", "left": "0rem" });
            $("#result").hide();
        }
    }
</script>